﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace SevenInvaders.LEVEL_DIEHL
{
    class DiehlEnemy : Enemy
    {
        //animation animation1;

        public static List<DiehlEnemy> list =  new List<DiehlEnemy>();

        public enum IAType { goLeft, goLeftUpAndDown };

        public IAType currentIA;

        public DiehlEnemy(Texture2D texture, Vector2 position)
            : base(texture)
        {
            this.Position = position;
            
            //animation1 = new animation();

            //animation1.frame.X = 0;
            //animation1.frame.Y = 370;
            //animation1.frame.Width = 71;
            //animation1.frame.Height = 83;

            //animation1.frames = 3;
            //animation1.fps = 5;

            //current_animation = animation1;
        }

        public override void Update(GameTime gameTime)
        {
            switch (currentIA)
            {
                case IAType.goLeft:
                    PositionX -= 10;
                    break;

                case IAType.goLeftUpAndDown:
                    PositionX -= 10;
                    PositionY -= Velocity.Y;
                    if (PositionY < 100)
                    {
                        Velocity = new Vector2(Velocity.X, -Velocity.Y);
                    }
                    break;

                default:
                    PositionX = 10;
                    break;
            }
            
        }
    }
}
